import pywapi

def get_weather():
    feed = pywapi.get_weather_from_yahoo('53110',units='imperial')
    
    weather_cond = {}
    image_addr_start = feed['html_description'].find("http")
    image_addr_end = feed['html_description'].find("gif") + 3
    weather_cond['Image'] = feed['html_description'][image_addr_start:image_addr_end]
    weather_cond['Current_Temp'] = feed['condition']['temp'] + "F" 
    weather_cond['Current_Conditions'] = feed['condition']['text'] 
    weather_cond['High_Tomorrow'] = feed['forecasts'][0]['high'] + "F" 
    weather_cond['Low_Tomorrow'] = feed['forecasts'][0]['low'] + "F" 
    weather_cond['Day_After_Tomorrow_Conditions'] = feed['forecasts'][0]['text']
    weather_cond['Day_After_Tomorrow_High'] = feed['forecasts'][1]['high'] + "F" 
    weather_cond['Day_After_Tomorrow_Low'] =feed['forecasts'][1]['low'] + "F" 
    weather_cond['Day_After_Tomorrow_Conditions'] = feed['forecasts'][1]['text']
    
    return weather_cond

if __name__ == '__main__':
    print get_weather()
    
    
    
